<%-- 
    Document   : ajouter-menu
    Created on : 25 mai 2012, 10:33:48
    Author     : TaKeO
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
        <title>Ajouter un menu</title>
    </head>
    <body>
    <div id="container">
        <div id="header">
            <%@include file="template/header.jsp" %>
        </div>
        <div id="center-layout">
            <div id="content">
                <h1>Ajouter un menu</h1>
                <form method="POST" name="form" class="form-horizontal">
                    <fieldset>
                        
                        <p class="error">
                            <c:forEach items="${errors}" var="error">
                                <c:out value="${error}"/>
                                <br />
                            </c:forEach>
                        </p>
                        
                        <div class="control-group">
                            <label class="control-label" for="nom">Nom du menu :</label>
                            <div class="controls">
                                <input type="text" name="nom" value="${menu.nom}">
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <label class="control-label" for="description">Description du menu :</label>
                            <div class="controls">
                                <input type="text" name="description" value="${menu.description}">
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <label class="control-label" for="prix">Prix du menu (€) :</label>
                            <div class="controls">
                                <input type="text" name="prix"  value="${menu.prix}">
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <label class="control-label" for="entree">Choisir une entrée</label>
                            <div class="controls">
                                <select id="entreeMenu" name="entree">
                                    <option value="none">Aucun</option>
                                    <c:forEach items="${entrees}" var="entree">
                                        <c:choose>
                                            <c:when test="${entree.id_produit eq entreeMenu.id_produit}">
                                                <option selected="true" value="${entree.id_produit}">${entree.libelle}</option>
                                            </c:when>
                                            <c:otherwise>
                                                <option value="${entree.id_produit}">${entree.libelle}</option>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                                    
                        <div class="control-group">
                            <label class="control-label" for="plat">Choisir un plat</label>
                            <div class="controls">
                                <select id="entreeMenu" name="plat">
                                    <option value="none">Aucun</option>
                                    <c:forEach items="${plats}" var="plat">
                                        <c:choose>
                                            <c:when test="${plat.id_produit eq platMenu.id_produit}">
                                                <option selected="true" value="${plat.id_produit}">${plat.libelle}</option>
                                            </c:when>
                                            <c:otherwise>
                                                <option value="${plat.id_produit}">${plat.libelle}</option>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                                   
                        <div class="control-group">
                            <label class="control-label" for="dessert">Choisir un dessert</label>
                            <div class="controls">
                                <select id="entreeMenu" name="dessert">
                                    <option value="none">Aucun</option>
                                    <c:forEach items="${desserts}" var="dessert">
                                        <c:choose>
                                            <c:when test="${dessert.id_produit eq dessertMenu.id_produit}">
                                                <option selected="true" value="${dessert.id_produit}">${dessert.libelle}</option>
                                            </c:when>
                                            <c:otherwise>
                                                <option value="${dessert.id_produit}">${dessert.libelle}</option>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        
                        <div class="control-group"> 
                            <div class="controls">
                                <c:choose>
                                    <c:when test="${not empty menu}">
                                        <input type="submit" value="Editer le menu" class="btn-primary"/>
                                    </c:when>
                                    <c:otherwise>
                                        <input type="submit" value="Créer le menu" class="btn-primary"/>
                                    </c:otherwise>
                                </c:choose>
                            </div>
                        </div>
                    </fieldset>
                </form>                                    
            </div>
        </div>
            <div id="right-layout">
                
            </div>
            <div id="left-layout">
                <%@include file="template/left-layout.jsp" %>
            </div>
    </div>
    </body>
</html>
